package com.aaa.system.Controller.Api;

import com.aaa.entity.LoginInfo;
import com.aaa.system.aop.annotation.Log;
import com.aaa.system.service.LoginLogService;
import com.aaa.system.vo.LoginInfoVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("system/api/loginLog")
public class ApiLoginLogController {

    @Resource
    private LoginLogService loginLogService;

    /**
     *查询全部的数据 分页  模糊
     */
    @PostMapping("getAllLog")
    public Result<IPage<LoginInfo>> getAllLog(@RequestBody LoginInfoVo loginInfoVo){
        return loginLogService.getAllLog(loginInfoVo);
    }
    /**
     * 删除 批量删除
     */
    @DeleteMapping("delLoginLog/{infoIds}")
    @Log(title = "删除登录日志信息",business_type = "3")
    public Result<Boolean> delLoginLog(@PathVariable Long[] infoIds){
        return loginLogService.delLoginLog(infoIds);
    }
    /**
     * 清空表单
     */
    @DeleteMapping("clearTable")
    @Log(title = "清空登录日志信息",business_type = "8")
    public Result<String> clearTable(){
        return loginLogService.clearTable();
    }
}
